"use strict";

const { Controller } = require("ee-core");
const {
  app: electronApp
} = require("electron");
const _ = require("lodash");
const metadbService = require("../service/database/metadb");



class metadataController  {

 async getMetaData() {
    let args= ["subject","grade","question_type"];
    const data = { 
      result: null,     
      code: 400,
    };
    let promises = args.map(async (arg) => {
        let res = await metadbService.getData(arg);
        return { [arg]: res };
    });
    data.result = await Promise.all(promises);
    return data;
 }

}

metadataController.toString = () => "[class metadataController]";
module.exports = metadataController;
